/**
 * Created by Bin_Shi on 2016/11/18.
 * 动作相关的脚本
 */
_canvas.addEventListener('mousemove', mouseMove);
_canvas.addEventListener('mousedown', mouseDown);
_canvas.addEventListener('mouseup', mouseUp);

function mouseMove(e){
    if(click){
        var sight = getSight(player, canvas);
        player.t_x = sight.x0 + e.clientX;
        player.t_y = sight.y0 + e.clientY;
    }
}

function mouseDown(e){
    var sight = getSight(player, canvas);
    player.t_x = sight.x0 + e.clientX;
    player.t_y = sight.y0 + e.clientY;
    player.v = v;
    click = true;
}

function mouseUp(e){
    click = false;
    player.v = 0;
}
